﻿<%@ Page Language="C#" AutoEventWireup="true" Inherits="WebApplication.PropertyUpdate" MasterPageFile="~/MasterPage.master" Codebehind="PropertyUpdate.aspx.cs" MaintainScrollPositionOnPostback="true" %>

<asp:Content ID="Content1" Runat="Server" 
             ContentPlaceHolderID="title">
             Ενημέρωση Ακινήτου
</asp:Content>


<asp:Content ID="Content2" Runat="Server" 
             ContentPlaceHolderID="body" >

            
            <h2>Ενημέρωση Και Ιστορικό Ακινήτου</h2>
            <hr />        
            <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Ενημέρωση" />
            <br />
            <table>
            <tr align="right"><td>Αριθμός Πρωτοκόλου:<asp:Label ID="ProtoNum" runat="server" ></asp:Label> </td><td align="right">Συντεταγμένες: <asp:TextBox ID="Coordinates" runat="server" Width="200px" /> </td></tr>
            <tr align="right"><td>
                Ημερομηνία Υπογραφής<asp:Calendar ID="Calendar1" runat="server" 
                    onselectionchanged="Calendar1_SelectionChanged" Height="180px" 
                    Width="296px" BackColor="White" BorderColor="#999999" CellPadding="4" 
                    DayNameFormat="Shortest" Font-Names="Verdana" Font-Size="8pt" ForeColor="Black">
                    <DayHeaderStyle BackColor="#CCCCCC" Font-Bold="True" Font-Size="7pt" />
                    <NextPrevStyle VerticalAlign="Bottom" />
                    <OtherMonthDayStyle ForeColor="#808080" />
                    <SelectedDayStyle BackColor="#666666" Font-Bold="True" ForeColor="White" />
                    <SelectorStyle BackColor="#CCCCCC" />
                    <TitleStyle BackColor="#999999" BorderColor="Black" Font-Bold="True" />
                    <TodayDayStyle BackColor="#CCCCCC" ForeColor="Black" />
                    <WeekendDayStyle BackColor="#FFFFCC" />
                </asp:Calendar>
            </td><td>
                Ημερονηνία Παραλαβής
                <asp:Calendar ID="Calendar2" runat="server" 
                onselectionchanged="Calendar2_SelectionChanged" Height="180px" Width="296px" 
                        BackColor="White" BorderColor="#999999" CellPadding="4" 
                        DayNameFormat="Shortest" Font-Names="Verdana" Font-Size="8pt" ForeColor="Black">
                    <DayHeaderStyle BackColor="#CCCCCC" Font-Bold="True" Font-Size="7pt" />
                    <NextPrevStyle VerticalAlign="Bottom" />
                    <OtherMonthDayStyle ForeColor="#808080" />
                    <SelectedDayStyle BackColor="#666666" Font-Bold="True" ForeColor="White" />
                    <SelectorStyle BackColor="#CCCCCC" />
                    <TitleStyle BackColor="#999999" BorderColor="Black" Font-Bold="True" />
                    <TodayDayStyle BackColor="#CCCCCC" ForeColor="Black" />
                    <WeekendDayStyle BackColor="#FFFFCC" />
                    </asp:Calendar>
            </td></tr>
            <tr align="right"><td>
                Επιφάνεια Ακινήτου (m<sup>2</sup>):&nbsp; 
            <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
            </td><td>
                Νομός:&nbsp;<asp:DropDownList 
                        ID="DropDownList1" runat="server" AutoPostBack="True" 
                        onselectedindexchanged="DropDownList1_SelectedIndexChanged">
                    </asp:DropDownList>
&nbsp;</td></tr>
            <tr align="right">
                <td>
                     <asp:Label ID="Label1" runat="server"></asp:Label>
                     Δήμος<asp:DropDownList ID="DropDownList2" runat="server" AutoPostBack="True" 
                         onselectedindexchanged="DropDownList2_SelectedIndexChanged">
                     </asp:DropDownList>
                     &nbsp;
                </td>
                <td>
                    Περιοχή: <asp:TextBox ID="TextBox4" runat="server"></asp:TextBox>
                </td>
            </tr>
           
           <tr align="right">
                <td>
                    Αριθμός ΟΣΔΕ:&nbsp; <asp:TextBox ID="TextBox5" runat="server"></asp:TextBox>
                </td>
                <td>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    Αριθμός Τεμμαχίου Αναδασμού:
                    <asp:TextBox ID="TextBox6" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr align="right">
                <td>
                    Γραφείο Καταχώρησης: 
                    <asp:TextBox ID="TextBox7" runat="server"></asp:TextBox>
                </td>
                <td>
                   Όνομα Ιδιοκτήτη:
                    <asp:TextBox ID="TextBox8" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr align="right">
                <td>
                    Διεύθυνση Ιδιοκτήτη: 
                    <asp:TextBox ID="TextBox9" runat="server"></asp:TextBox>
                </td>
                <td>
                   Τ/Φ Ιδιοκτήτη:
                    <asp:TextBox ID="TextBox10" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr align="right">
                <td>
                    Ημερομηνία 1ης Σποράς<asp:Calendar ID="Calendar3" runat="server" 
                    onselectionchanged="Calendar3_SelectionChanged" Height="180px" Width="296px" 
                        BackColor="White" BorderColor="#999999" CellPadding="4" 
                        DayNameFormat="Shortest" Font-Names="Verdana" Font-Size="8pt" ForeColor="Black">
                        <DayHeaderStyle BackColor="#CCCCCC" Font-Bold="True" Font-Size="7pt" />
                        <NextPrevStyle VerticalAlign="Bottom" />
                        <OtherMonthDayStyle ForeColor="#808080" />
                        <SelectedDayStyle BackColor="#666666" Font-Bold="True" ForeColor="White" />
                        <SelectorStyle BackColor="#CCCCCC" />
                        <TitleStyle BackColor="#999999" BorderColor="Black" Font-Bold="True" />
                        <TodayDayStyle BackColor="#CCCCCC" ForeColor="Black" />
                        <WeekendDayStyle BackColor="#FFFFCC" />
                    </asp:Calendar>
                </td>
                <td>
                    Ημερομηνία 2ης Σποράς<br />
                <asp:Calendar ID="Calendar4" runat="server" 
                onselectionchanged="Calendar4_SelectionChanged" Height="180px" Width="296px" 
                        BackColor="White" BorderColor="#999999" CellPadding="4" 
                        DayNameFormat="Shortest" Font-Names="Verdana" Font-Size="8pt" ForeColor="Black">
                    <DayHeaderStyle BackColor="#CCCCCC" Font-Bold="True" Font-Size="7pt" />
                    <NextPrevStyle VerticalAlign="Bottom" />
                    <OtherMonthDayStyle ForeColor="#808080" />
                    <SelectedDayStyle BackColor="#666666" Font-Bold="True" ForeColor="White" />
                    <SelectorStyle BackColor="#CCCCCC" />
                    <TitleStyle BackColor="#999999" BorderColor="Black" Font-Bold="True" />
                    <TodayDayStyle BackColor="#CCCCCC" ForeColor="Black" />
                    <WeekendDayStyle BackColor="#FFFFCC" />
                    </asp:Calendar>
                </td>
            </tr>
            <tr align="right">
                <td>
                           Σπορά 1η, Σπόρος 
                           (kg): <asp:TextBox ID="TextBox11" runat="server"></asp:TextBox>
                </td>
                <td>
                    Σπορά 2η, Σπορος
                    (kg):
                    <asp:TextBox ID="TextBox12" runat="server" ></asp:TextBox>
                </td>
            </tr>
            <tr align="right"><td>
            <table>
            <tr>
                <td>1η Σπορά-Κωδικός Σπόρου:</td>
                <td><asp:TextBox ID="SeedCode1" runat="server"></asp:TextBox></td>
            </tr></table>
            </td><td>
            <table><tr>
                <td>2η Σπορά-Κωδικός Σπόρου:</td>
                <td><asp:TextBox ID="SeedCode2" runat="server"></asp:TextBox>
                </td>
            </tr></table>
            </td></tr>
        
            <tr align="right">
            <td>
                <table>
                    <tr><td>Άποψη Γεωπόνου</td></tr>
                    <tr><td>
                        <asp:TextBox ID="TextBox13" runat="server" Height="160px" Width="251px" TextMode="MultiLine"></asp:TextBox></td></tr>               
                    
                </table>
            </td>
            <td>
            <br />
                Ημερομηνία Άποψης Γεωπόνου<asp:Calendar 
                    ID="Calendar5" runat="server" 
                onselectionchanged="Calendar5_SelectionChanged" Height="180px" Width="296px" 
                    BackColor="White" BorderColor="#999999" CellPadding="4" 
                    DayNameFormat="Shortest" Font-Names="Verdana" Font-Size="8pt" ForeColor="Black">
                    <DayHeaderStyle BackColor="#CCCCCC" Font-Bold="True" Font-Size="7pt" />
                    <NextPrevStyle VerticalAlign="Bottom" />
                    <OtherMonthDayStyle ForeColor="#808080" />
                    <SelectedDayStyle BackColor="#666666" Font-Bold="True" ForeColor="White" />
                    <SelectorStyle BackColor="#CCCCCC" />
                    <TitleStyle BackColor="#999999" BorderColor="Black" Font-Bold="True" />
                    <TodayDayStyle BackColor="#CCCCCC" ForeColor="Black" />
                    <WeekendDayStyle BackColor="#FFFFCC" />
                </asp:Calendar>
            </td>
            </tr>
        </table>
        <br />
        <asp:Button ID="Button3" runat="server" onclick="Button1_Click" Text="Ενημέρωση" />
    <hr />
            <br />
            Ιστορικό Ακινήτου
            <br />

    <asp:Panel ID="Panel1" runat="server" ScrollBars="Horizontal">
            <asp:GridView ID="GridView1" runat="server" AllowSorting="True" 
                AutoGenerateColumns="False" CellPadding="4" DataKeyNames="ID" 
                DataSourceID="LinqHistories" ForeColor="#333333" ShowFooter="True" onrowcommand="GridView1_RowCommand" 
                onprerender="grid_preRender" onrowupdating="GridRowUp">
                <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                <Columns>



                    <asp:TemplateField ShowHeader="False">

                        <EditItemTemplate>
                            <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True" 
                                CommandName="Update" Text="Ενημέρωση"></asp:LinkButton>
                            &nbsp;<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" 
                                CommandName="Cancel" Text="Ακύρωση"></asp:LinkButton>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" 
                                CommandName="Edit" Text="Αλλαγή"></asp:LinkButton>
                            &nbsp;<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" 
                                CommandName="Delete" Text="Διαγραφή"></asp:LinkButton>
                        </ItemTemplate>
                       <FooterTemplate>
                            <asp:Button ID="Button4" runat="server" CommandName="Insert" Text="Εισαγωγή" />
                        </FooterTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField ControlStyle-Width="0px" HeaderText="ΙΣΤΟΡΙΚΟ" 
                        InsertVisible="False" visible="false">
                        <ItemTemplate>
                            <asp:Label ID="Label2" runat="server" Text='<%# Bind("ID") %>'></asp:Label>
                        </ItemTemplate>
                        
                        <EditItemTemplate>
                            <asp:Label ID="Label3" runat="server" Text='<%# Eval("ID") %>'></asp:Label>
                        </EditItemTemplate>
                        <ControlStyle Width="0px" />
                        <ItemStyle Width="0px" />
                    </asp:TemplateField>
                    <asp:BoundField DataField="PropertyID" HeaderText="PropertyID" 
                        SortExpression="PropertyID" Visible="false" ReadOnly="true" />
                    <asp:TemplateField HeaderText="Έτος" SortExpression="YearDate">
                        <FooterTemplate>
                            <asp:TextBox ID="year" runat="server" Text='<%# Bind("YearDate") %>'></asp:TextBox>
                        </FooterTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label4" runat="server" Text='<%# Bind("YearDate") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Υπεύθυνος Γραφείου" 
                        SortExpression="OfficeSupervisor">
                        <ItemTemplate>
                            <asp:Label ID="Label5" runat="server" Text='<%# Bind("OfficeSupervisor") %>'></asp:Label>
                        </ItemTemplate>
                                                <FooterTemplate>
                            <asp:TextBox ID="officesupervisor" runat="server" Text='<%# Bind("OfficeSupervisor") %>'></asp:TextBox>
                        </FooterTemplate>

                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox21" runat="server" 
                                Text='<%# Bind("OfficeSupervisor") %>'></asp:TextBox>
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Υπεύθυνος Καλλιέργειας" 
                        SortExpression="FieldSupervisor">
                        <ItemTemplate>
                            <asp:Label ID="Label6" runat="server" Text='<%# Bind("FieldSupervisor") %>'></asp:Label>
                        </ItemTemplate>
                                                <FooterTemplate>
                            <asp:TextBox ID="fieldsupervisor" runat="server" Text='<%# Bind("FieldSupervisor") %>'></asp:TextBox>
                        </FooterTemplate>

                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox22" runat="server" Text='<%# Bind("FieldSupervisor") %>'></asp:TextBox>
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Γεωπόνος Καλλιέργειας" SortExpression="agriculturist">
                        <ItemTemplate>
                            <asp:Label ID="LabelAgri" runat="server" Text='<%# Bind("agriculturist") %>'></asp:Label>
                        </ItemTemplate>
                                                <FooterTemplate>
                            <asp:TextBox ID="agriculturist" runat="server" Text='<%# Bind("agriculturist") %>'></asp:TextBox>
                        </FooterTemplate>

                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox23" runat="server" Text='<%# Bind("agriculturist") %>'></asp:TextBox>
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Άποψη Γεωπόνου" 
                        SortExpression="agriculturistApopsi">
                        <ItemTemplate>
                            <asp:Label ID="Label7" runat="server" Text='<%# Bind("agriculturistApopsi") %>'></asp:Label>
                        </ItemTemplate>
                                                <FooterTemplate>
                            <asp:TextBox ID="agriculturistApopsi" runat="server" Text='<%# Bind("agriculturistApopsi") %>'></asp:TextBox>
                        </FooterTemplate>

                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox24" runat="server" 
                                Text='<%# Bind("agriculturistApopsi") %>'></asp:TextBox>
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Ημερομηνία Άποψης Γεωπόνου" 
                        SortExpression="agriculturistApopsiDate">
                        <ItemTemplate>
                            <asp:Label ID="Label8" runat="server" 
                                Text='<%# Bind("agriculturistApopsiDate", "{0:dd/MM/yyyy}") %>'></asp:Label>
                        </ItemTemplate>
                    <FooterTemplate>
                        <asp:Button ID="agriculturistApopsidateButton" runat="server" Text="Ημερομηνία Άποψης Γεωπόνου"  OnClick="agriculturistApopsiDateShow" />
                        <asp:Calendar ID="agriculturistApopsidate" DayStyle-ForeColor='White' SelectedDate ='<%# Bind("agriculturistApopsiDate") %>' 
                        runat="server" Visible="false" OnSelectionChanged="agriculturistApopsiDateHide"></asp:Calendar>
                        </FooterTemplate>

                        <EditItemTemplate>

<!--                            <asp:TextBox ID="TextBox25" runat="server" 
                                Text='<%# Bind("agriculturistApopsiDate", "{0:dd/MM/yyyy}") %>'></asp:TextBox>
                                -->
                                <asp:Calendar ID="agriculturistApopsidate" SelectedDate ='<%# Bind("agriculturistApopsiDate") %>' runat="server"></asp:Calendar>
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Μηχάνημα Θερισμού 1" 
                        SortExpression="MixanimaTherismou1">
                        <ItemTemplate>
                            <asp:Label ID="Label9" runat="server" Text='<%# Bind("MixanimaTherismou1") %>'></asp:Label>
                        </ItemTemplate>
                                                <FooterTemplate>
                            <asp:TextBox ID="mixanimatherismou1" runat="server" Text='<%# Bind("MixanimaTherismou1") %>'></asp:TextBox>
                        </FooterTemplate>

                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox26" runat="server" 
                                Text='<%# Bind("MixanimaTherismou1") %>'></asp:TextBox>
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="ΤΦ Μηχανήματος 1" SortExpression="TFMixanimatos1">
                        <ItemTemplate>
                            <asp:Label ID="Label10" runat="server" Text='<%# Bind("TFMixanimatos1") %>'></asp:Label>
                        </ItemTemplate>
                                                <FooterTemplate>
                            <asp:TextBox ID="tfmixanimatos1" runat="server" Text='<%# Bind("TFMixanimatos1") %>'></asp:TextBox>
                        </FooterTemplate>

                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox211" runat="server" Text='<%# Bind("TFMixanimatos1") %>'></asp:TextBox>
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Μηχάνημα Θερισμού 2" 
                        SortExpression="MixanimaTherismou2">
                        <ItemTemplate>
                            <asp:Label ID="Label212" runat="server" Text='<%# Bind("MixanimaTherismou2") %>'></asp:Label>
                        </ItemTemplate>
                                                <FooterTemplate>
                            <asp:TextBox ID="mixanimatherismou2" runat="server" Text='<%# Bind("MixanimaTherismou2") %>'></asp:TextBox>
                        </FooterTemplate>

                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox28" runat="server" 
                                Text='<%# Bind("MixanimaTherismou2") %>'></asp:TextBox>
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="ΤΦ Μηχανήματος 2" SortExpression="TFMixanimatos2">
                        <ItemTemplate>
                            <asp:Label ID="Label213" runat="server" Text='<%# Bind("TFMixanimatos2") %>'></asp:Label>
                        </ItemTemplate>
                                                <FooterTemplate>
                            <asp:TextBox ID="tfmixanimatos2" runat="server" Text='<%# Bind("TFMixanimatos2") %>'></asp:TextBox>
                        </FooterTemplate>

                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox29" runat="server" Text='<%# Bind("TFMixanimatos2") %>'></asp:TextBox>
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Παραγωγή Χωραφιού" SortExpression="Production">
                        <ItemTemplate>
                            <asp:Label ID="Label14" runat="server" Text='<%# Bind("Production") %>'></asp:Label>
                        </ItemTemplate>
                        <FooterTemplate>
                            <asp:TextBox ID="production" runat="server" Text='<%# Bind("Production") %>'></asp:TextBox>
                        </FooterTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox30" runat="server" Text='<%# Bind("Production") %>'></asp:TextBox>
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Ημερομηνία Θερισμού" SortExpression="HarvestDate">
                        <ItemTemplate>
                            <asp:Label ID="Label15" runat="server" Text='<%# Bind("HarvestDate", "{0:dd/MM/yyyy}") %>'></asp:Label>
                        </ItemTemplate>
                                                                        <FooterTemplate>
                                                    <asp:Calendar ID="HarvestDate"  DayStyle-ForeColor='White' SelectedDate ='<%# Bind("HarvestDate") %>' Visible="false"  runat="server" OnSelectionChanged="HarvestDateHide"></asp:Calendar>
                                                    <asp:Button ID="HarvestDateButton" runat="server" Text="Ημερομηνία Θερισμού" OnClick="HarvestDateShow" />
                        </FooterTemplate>

                        <EditItemTemplate>
                        <asp:Calendar ID="HarvestDate" SelectedDate ='<%# Bind("HarvestDate") %>' runat="server"></asp:Calendar>
                       </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Είδος Παραγωγής - Σπόρος" 
                        SortExpression="ProductionKindSeed">
                        <ItemTemplate>
                            <asp:Label ID="Label36" runat="server" Text='<%# Bind("ProductionKindSeed") %>'></asp:Label>
                        </ItemTemplate>
                        <FooterTemplate>
                            <asp:TextBox ID="productionkindseed" runat="server" Text='<%# Bind("ProductionKindSeed") %>'></asp:TextBox>
                        </FooterTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox312" runat="server" 
                                Text='<%# Bind("ProductionKindSeed") %>'></asp:TextBox>
                        </EditItemTemplate>
                    </asp:TemplateField>
                     <asp:TemplateField HeaderText="Κωδικός Σπόρου" 
                        SortExpression="KodikosSporou">
                        <ItemTemplate>
                            <asp:Label ID="SeedCodeLabel" runat="server" Text='<%# Bind("KodikosSporou") %>'></asp:Label>
                        </ItemTemplate>
                        <FooterTemplate>
                            <asp:TextBox ID="SeedCodeText" runat="server" Text='<%# Bind("KodikosSporou") %>'></asp:TextBox>
                        </FooterTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="SeedCodeTextInsert" runat="server" 
                                Text='<%# Bind("KodikosSporou") %>'></asp:TextBox>
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Ποσότητα Παραγωγής - Σπόρος" 
                        SortExpression="ProductionQuantity">
                        <ItemTemplate>
                            <asp:Label ID="Label318" runat="server" Text='<%# Bind("ProductionQuantitySeed") %>'></asp:Label>
                        </ItemTemplate>
                        <FooterTemplate>
                            <asp:TextBox ID="productionquantity" runat="server" Text='<%# Bind("ProductionQuantitySeed") %>'></asp:TextBox>
                        </FooterTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox314" runat="server" 
                                Text='<%# Bind("ProductionQuantitySeed") %>'></asp:TextBox>
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Τιμή Αγοράς Παραγωγής - Σπόρος" 
                        SortExpression="ProductionBuyPrice">
                        <ItemTemplate>
                            <asp:Label ID="Label419" runat="server" Text='<%# Bind("ProductionBuyPriceSeed") %>'></asp:Label>
                        </ItemTemplate>
                        <FooterTemplate>
                            <asp:TextBox ID="productionbuyprice" runat="server" Text='<%# Bind("ProductionBuyPriceSeed") %>'></asp:TextBox>
                        </FooterTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox415" runat="server" 
                                Text='<%# Bind("ProductionBuyPriceSeed") %>'></asp:TextBox>
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Είδος Παραγωγής - Μάζα" 
                        SortExpression="ProductionKindMass">
                        <ItemTemplate>
                            <asp:Label ID="Label17" runat="server" Text='<%# Bind("ProductionKindMass") %>'></asp:Label>
                        </ItemTemplate>
                        <FooterTemplate>
                            <asp:TextBox ID="productionkindmass" runat="server" Text='<%# Bind("ProductionKindMass") %>'></asp:TextBox>
                        </FooterTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox313" runat="server" 
                                Text='<%# Bind("ProductionKindMass") %>'></asp:TextBox>
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Ποσότητα Παραγωγής - Μάζα" 
                        SortExpression="ProductionQuantityMass">
                        <ItemTemplate>
                            <asp:Label ID="Label345" runat="server" Text='<%# Bind("ProductionQuantityMass") %>'></asp:Label>
                        </ItemTemplate>
                        <FooterTemplate>
                            <asp:TextBox ID="productionquantitymass" runat="server" Text='<%# Bind("ProductionQuantityMass") %>'></asp:TextBox>
                        </FooterTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox666" runat="server" 
                                Text='<%# Bind("ProductionQuantityMass") %>'></asp:TextBox>
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Τιμή Αγοράς Παραγωγής - Μάζα" 
                        SortExpression="ProductionBuyPriceMass">
                        <ItemTemplate>
                            <asp:Label ID="Label999" runat="server" Text='<%# Bind("ProductionBuyPriceMass") %>'></asp:Label>
                        </ItemTemplate>
                        <FooterTemplate>
                            <asp:TextBox ID="productionbuypricemass" runat="server" Text='<%# Bind("ProductionBuyPriceMass") %>'></asp:TextBox>
                        </FooterTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox996" runat="server" 
                                Text='<%# Bind("ProductionBuyPriceMass") %>'></asp:TextBox>
                        </EditItemTemplate>
                    </asp:TemplateField>
                    
                </Columns>
                <EditRowStyle BackColor="#FFFFFF" />
                <FooterStyle BackColor="#262626" Font-Bold="True" ForeColor="White" />
                <HeaderStyle BackColor="#262626" Font-Bold="True" ForeColor="White" />
                <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />





  <EmptyDataTemplate>
            <table>
            <tr align="right"><td>
                Έτος: <asp:TextBox ID="eEtosText" runat="server" ></asp:TextBox>
            </td>
            <td></td>
            <td></td>
            <tr align="right"><td>
                Υπεύθυνος Γραφείου: <asp:TextBox ID="eYpeuthinosGrafeiouText" runat="server" ></asp:TextBox>
            </td>
            <td>
                Υπεύθυνος Καλλιέργειας <asp:TextBox ID="eYpeuthinosKalText" runat="server"></asp:TextBox>
            </td>
             <td>
                 Γεωπόνος Καλλιέργειας <asp:TextBox ID="eGeoponosText" runat="server"></asp:TextBox>
             </td>
             </tr>
            <!---2i seira--->
            <tr align="right">
              <td><table>
                    <tr align="left"><td>Άποψη Γεωπόνου</td></tr> 
                    <tr align="left"><td><asp:TextBox ID="eGeopApopsiText" runat="server" 
                            Height="148px" Width="194px" TextMode="MultiLine"></asp:TextBox>  </td></tr>
                </table>
              </td>
              <td>
                    Ημερομηνία Άποψης
                    <asp:Calendar  runat="server" ID="eApopsiGeoDate" BackColor="White" BorderColor="#999999" 
                        CellPadding="4" DayNameFormat="Shortest" Font-Names="Verdana" Font-Size="8pt" 
                        ForeColor="Black" Height="180px" Width="200px">
                        <DayHeaderStyle BackColor="#CCCCCC" Font-Bold="True" Font-Size="7pt" />
                        <NextPrevStyle VerticalAlign="Bottom" />
                        <OtherMonthDayStyle ForeColor="#808080" />
                        <SelectedDayStyle BackColor="#666666" Font-Bold="True" ForeColor="White" />
                        <SelectorStyle BackColor="#CCCCCC" />
                        <TitleStyle BackColor="#999999" BorderColor="Black" Font-Bold="True" />
                        <TodayDayStyle BackColor="#CCCCCC" ForeColor="Black" />
                        <WeekendDayStyle BackColor="#FFFFCC" />
                    </asp:Calendar>
                </td>
                <td>Ημερομηνία Θερισμού 
                    <asp:Calendar runat="server" ID="eTherismosDate" 
                        BackColor="White" BorderColor="#999999" CellPadding="4" 
                        DayNameFormat="Shortest" Font-Names="Verdana" Font-Size="8pt" ForeColor="Black" 
                        Height="180px" Width="200px">
                    <DayHeaderStyle BackColor="#CCCCCC" Font-Bold="True" Font-Size="7pt" />
                    <NextPrevStyle VerticalAlign="Bottom" />
                    <OtherMonthDayStyle ForeColor="#808080" />
                    <SelectedDayStyle BackColor="#666666" Font-Bold="True" ForeColor="White" />
                    <SelectorStyle BackColor="#CCCCCC" />
                    <TitleStyle BackColor="#999999" BorderColor="Black" Font-Bold="True" />
                    <TodayDayStyle BackColor="#CCCCCC" ForeColor="Black" />
                    <WeekendDayStyle BackColor="#FFFFCC" />
                    </asp:Calendar> </td>
             </tr>
             <!---3i seira--->
            <tr align="right">
             <td>
                    <table>
                       <tr>
                         <td>
                             Παραγωγή Χωραφιού:
                         </td>
                        <td>
                            <asp:TextBox ID="eParagogiText" runat="server"></asp:TextBox>
                        </td>
                       </tr>
                    </table>
             </td>
             <td>
                    <table>
                        <tr>
                            <td>
                                Μηχάνημα Θερισμού 1:
                            </td>
                            <td>
                                <asp:TextBox ID="eMixanima1Text" runat="server"></asp:TextBox>
                            </td>
                        </tr>
                    </table>
            </td>
            <td>
                <table>
                    <tr>
                        <td>
                            Μηχάνημα Θερισμού 1 ΤΦ:
                        </td>
                        <td>
                            <asp:TextBox ID="eMihanima1TFText" runat="server"></asp:TextBox> 
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <!---4i seira-->
        <tr align="right">
            <td>
                <table>
                    <tr>
                        <td>
                            Μηχάνημα Θερισμού 2:</td>
                        <td>
                            <asp:TextBox ID="eMihanima2Text" runat="server"></asp:TextBox>
                        </td>
                    </tr>
                </table>
            </td>
            <td>
                <table>
                    <tr>
                        <td>
                              Μηχάνημα Θερισμού 2 ΤΦ:
                        </td>
                        <td>
                            <asp:TextBox ID="eMixanima2TFText" runat="server"></asp:TextBox>
                        </td>
                    </tr>
                </table>
            </td>
            <td></td>    
        </tr>
        <!---5i seira--->
        <tr align="right">
            <td>
                <table>
                    <tr>
                        <td>
                            Είδος Παραγωγής Σπόρος:</td>
                        <td>
                            <asp:TextBox ID="eProdSeedText" runat="server"></asp:TextBox>
                        </td>
                    </tr>
                </table>
            </td>
            <td>
                <table>
                    <tr>
                        <td>
                            Ποσότητα Παραγωγής Σπόρος:</td>
                        <td>
                            <asp:TextBox ID="eProdSporosQuantText" runat="server"></asp:TextBox>
                        </td>
                    </tr>
                </table>
            </td>
            <td>
                <table><tr>
                    <td> 
                        Τιμή Παραγωγής Σπόρος:
                    </td>
                    <td>
                         <asp:TextBox ID="ePriceSeed" runat="server"></asp:TextBox>
                    </td>
                </tr></table>
            </td>
       </tr>
       <!-------emvolimi 6i ------>
        <tr align="right">
            <td>
                <table>
                    <tr>
                        <td>
                            Κωδικός Σπόρου:</td>
                        <td>
                            <asp:TextBox ID="SeedCodeEmpty" runat="server"></asp:TextBox>
                        </td>
                       </tr>
                  </table>
                </td>
            <td>
            </td>
            <td></td>
        </tr>
       <!---7i seira--->
        <tr align="right">
            <td>
                <table>
                    <tr>
                        <td>
                            Είδος Παραγωγής Μάζα:</td>
                        <td>
                            <asp:TextBox ID="eProdMassText" runat="server"></asp:TextBox>
                        </td>
                    </tr>
                </table>
            </td>
            <td>
                <table>
                    <tr>
                        <td>
                            Ποσότητα Παραγωγής Μάζα:</td>
                        <td>
                            <asp:TextBox ID="eProdMassQuantText" runat="server"></asp:TextBox>
                        </td>
                    </tr>
                </table>
            </td>
            <td>
                <table><tr>
                    <td> 
                        Τιμή Παραγωγής Μάζα:
                    </td>
                    <td>
                         <asp:TextBox ID="eMassPriceText" runat="server"></asp:TextBox>
                    </td>
                </tr></table>
            </td>
       </tr>          
    </table>
            <br />
            <asp:Button ID="eButton1" runat="server" Text="Αποθήκευση 1ου Ιστορικού" 
                CommandName="EmptyInsert" UseSubmitBehavior="False" />
            <br />
        </EmptyDataTemplate>


            </asp:GridView>
            <asp:LinqDataSource ID="LinqHistories" runat="server" 
                ContextTypeName="WebApplication.DataClassesDataContext" EnableDelete="True" 
                EnableInsert="True" EnableUpdate="True" OrderBy="YearDate desc" 
                TableName="PropertyHistories" Where="PropertyID == @PropertyID">
                <WhereParameters>
                    <asp:QueryStringParameter Name="PropertyID" QueryStringField="property" 
                        Type="Int64" />
                </WhereParameters>
            </asp:LinqDataSource>


            <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" 
                DataSourceID="LinqHistoryHidden" Visible="False">
                <Columns>
                <asp:TemplateField HeaderText="Έτος" SortExpression="YearDate">
                        
                        <ItemTemplate>
                            <asp:Label ID="Label4" runat="server" Text='<%# Bind("YearDate") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                  <asp:TemplateField HeaderText="Υπεύθυνος Γραφείου" 
                        SortExpression="OfficeSupervisor">
                        <ItemTemplate>
                            <asp:Label ID="Label5" runat="server" Text='<%# Bind("OfficeSupervisor") %>'></asp:Label>
                        </ItemTemplate>
                         
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Υπεύθυνος Καλλιέργειας" 
                        SortExpression="FieldSupervisor">
                        <ItemTemplate>
                            <asp:Label ID="Label6" runat="server" Text='<%# Bind("FieldSupervisor") %>'></asp:Label>
                        </ItemTemplate>
                         
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Γεωπόνος Καλλιέργειας" SortExpression="agriculturist">
                        <ItemTemplate>
                            <asp:Label ID="LabelAgri" runat="server" Text='<%# Bind("agriculturist") %>'></asp:Label>
                        </ItemTemplate>
                            
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Άποψη Γεωπόνου" 
                        SortExpression="agriculturistApopsi">
                        <ItemTemplate>
                            <asp:Label ID="Label7" runat="server" Text='<%# Bind("agriculturistApopsi") %>'></asp:Label>
                        </ItemTemplate>
                                           
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Ημερομηνία Άποψης Γεωπόνου" 
                        SortExpression="agriculturistApopsiDate">
                        <ItemTemplate>
                            <asp:Label ID="Label8" runat="server" 
                                Text='<%# Bind("agriculturistApopsiDate", "{0:dd/MM/yyyy}") %>'></asp:Label>
                        </ItemTemplate>
                    
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Μηχάνημα Θερισμού 1" 
                        SortExpression="MixanimaTherismou1">
                        <ItemTemplate>
                            <asp:Label ID="Label9" runat="server" Text='<%# Bind("MixanimaTherismou1") %>'></asp:Label>
                        </ItemTemplate>
                                           
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="ΤΦ Μηχανήματος 1" SortExpression="TFMixanimatos1">
                        <ItemTemplate>
                            <asp:Label ID="Label10" runat="server" Text='<%# Bind("TFMixanimatos1") %>'></asp:Label>
                        </ItemTemplate>
                                           
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Μηχάνημα Θερισμού 2" 
                        SortExpression="MixanimaTherismou2">
                        <ItemTemplate>
                            <asp:Label ID="Label212" runat="server" Text='<%# Bind("MixanimaTherismou2") %>'></asp:Label>
                        </ItemTemplate>
                       
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="ΤΦ Μηχανήματος 2" SortExpression="TFMixanimatos2">
                        <ItemTemplate>
                            <asp:Label ID="Label213" runat="server" Text='<%# Bind("TFMixanimatos2") %>'></asp:Label>
                        </ItemTemplate>
                       
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Παραγωγή Χωραφιού" SortExpression="Production">
                        <ItemTemplate>
                            <asp:Label ID="Label14" runat="server" Text='<%# Bind("Production") %>'></asp:Label>
                        </ItemTemplate>
                       
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Ημερομηνία Θερισμού" SortExpression="HarvestDate">
                        <ItemTemplate>
                            <asp:Label ID="Label15" runat="server" Text='<%# Bind("HarvestDate", "{0:dd/MM/yyyy}") %>'></asp:Label>
                        </ItemTemplate>
                       
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Είδος Παραγωγής - Σπόρος" 
                        SortExpression="ProductionKindSeed">
                        <ItemTemplate>
                            <asp:Label ID="Label36" runat="server" Text='<%# Bind("ProductionKindSeed") %>'></asp:Label>
                        </ItemTemplate>
                       
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Κωδικός Παραγωγής - Σπόρος" 
                        SortExpression="KodikosSporou">
                        <ItemTemplate>
                            <asp:Label ID="Label99" runat="server" Text='<%# Bind("KodikosSporou") %>'></asp:Label>
                        </ItemTemplate>
                       
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Ποσότητα Παραγωγής - Σπόρος" 
                        SortExpression="ProductionQuantity">
                        <ItemTemplate>
                            <asp:Label ID="Label318" runat="server" Text='<%# Bind("ProductionQuantitySeed") %>'></asp:Label>
                        </ItemTemplate>
                       
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Τιμή Αγοράς Παραγωγής - Σπόρος" 
                        SortExpression="ProductionBuyPrice">
                        <ItemTemplate>
                            <asp:Label ID="Label419" runat="server" Text='<%# Bind("ProductionBuyPriceSeed") %>'></asp:Label>
                        </ItemTemplate>
                       
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Είδος Παραγωγής - Μάζα" 
                        SortExpression="ProductionKindMass">
                        <ItemTemplate>
                            <asp:Label ID="Label17" runat="server" Text='<%# Bind("ProductionKindMass") %>'></asp:Label>
                        </ItemTemplate>
                       
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Ποσότητα Παραγωγής - Μάζα" 
                        SortExpression="ProductionQuantityMass">
                        <ItemTemplate>
                            <asp:Label ID="Label345" runat="server" Text='<%# Bind("ProductionQuantityMass") %>'></asp:Label>
                        </ItemTemplate>
                       
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Τιμή Αγοράς Παραγωγής - Μάζα" 
                        SortExpression="ProductionBuyPriceMass">
                        <ItemTemplate>
                            <asp:Label ID="Label999" runat="server" Text='<%# Bind("ProductionBuyPriceMass") %>'></asp:Label>
                        </ItemTemplate>
                     
                    </asp:TemplateField>
                    
                </Columns>
            </asp:GridView>
            <asp:LinqDataSource ID="LinqHistoryHidden" runat="server" 
                ContextTypeName="WebApplication.DataClassesDataContext" EntityTypeName="" 
                OrderBy="YearDate" 
                Select="new (YearDate, OfficeSupervisor, FieldSupervisor, agriculturist, agriculturistApopsi, agriculturistApopsiDate, MixanimaTherismou1, TFMixanimatos1, MixanimaTherismou2, TFMixanimatos2, Production, HarvestDate, ProductionKindSeed, ProductionKindMass, ProductionQuantitySeed, ProductionQuantityMass, ProductionBuyPriceSeed, ProductionBuyPriceMass, KodikosSporou)" 
                TableName="PropertyHistories" Where="PropertyID == @PropertyID">
                <WhereParameters>
                    <asp:QueryStringParameter Name="PropertyID" QueryStringField="property" 
                        Type="Int64" />
                </WhereParameters>
            </asp:LinqDataSource>
    <br />
                    </asp:Panel>
    <asp:Button ID="Button2" runat="server" onclick="Button2_Click" 
                            Text="Εξαγωγή σε Excel" />

<br />
<br />


</asp:Content>
